package com.woniu.secondhand.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.woniu.secondhand.entity.dto.SellProductSearchDTO;
import com.woniu.secondhand.entity.dto.WantProductSearchDTO;
import com.woniu.secondhand.entity.vo.SellProductSearchVO;
import com.woniu.secondhand.entity.vo.WantProductSearchVO;
import com.woniu.secondhand.pojo.SecondhandProduct;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author HMMT
 * @since 2023-05-20
 */
@Mapper
public interface SecondhandProductMapper extends BaseMapper<SecondhandProduct> {
    /**
     * 购买页面查询
     *
     * @param page
     * @param sellProductSearchDTO
     * @return
     */
    IPage<SellProductSearchVO> searchSell(IPage page, @Param("sellProductSearchDTO") SellProductSearchDTO sellProductSearchDTO);

    /**
     * 求购页面查询
     *
     * @param page
     * @param wantProductSearchDTO
     * @return
     */
    IPage<WantProductSearchVO> searchWant(IPage page, @Param("wantProductSearchDTO") WantProductSearchDTO wantProductSearchDTO);

    /**
     * 出售审核查询
     *
     * @param page
     * @param sellProductSearchDTO
     * @return
     */
    IPage<SecondhandProduct> searchSellAndUnverified(IPage page, @Param("sellProductSearchDTO") SellProductSearchDTO sellProductSearchDTO);

    /**
     * 求购审核查询
     *
     * @param page
     * @param wantProductSearchDTO
     * @return
     */
    IPage<SecondhandProduct> searchWantAndUnverified(IPage page, @Param("wantProductSearchDTO") WantProductSearchDTO wantProductSearchDTO);
}
